#ifndef SPRITEFACTORY_H
#define SPRITEFACTORY_H
#include <vector>
#include "sprite.h"
#include "lsystem.h"
#include "gamedata.h"
#include "frameFactory.h"
class SpriteFactory {
public:

	SpriteFactory():sprites(),gameData(Gamedata::getInstance()){}
	~SpriteFactory(){
		for(unsigned int i=0;i<sprites.size();i++){
			delete sprites[i];
		}
		sprites.clear();
		std::cout<<"delete spritefacotry"<<std::endl;
	}
	void addSprite(Sprite * sprite);
	void addSprite(const Vector2f& pos, const Vector2f& vel,
                 const string &filename,FrameFactory *ff = NULL);
	std::vector<Sprite *> getSprites() const;

private:
	std::vector<Sprite *> sprites;
	const Gamedata* gameData;
	
	SpriteFactory(const SpriteFactory&);
	SpriteFactory& operator=(const SpriteFactory&);
};

#endif
